
window.addEventListener("DOMContentLoaded", function() {
    // mobile menu
  const openBtn = document.getElementById('burger');
  const mobileNavigation = document.querySelector('.header__menu_mobile');
  const closeBtn = document.querySelector('.header__burger-btn');
    
    openBtn.addEventListener('click', function () {
        mobileNavigation.classList.toggle('active');
        closeBtn.classList.toggle('active');
    })
    // trainers slider swiper slider
    let swiper = new Swiper(".trainers__slider", {
        slidesPerView: 1,
        navigation: {
            nextEl: ".trainers__arrow-right",
            prevEl: ".trainers__arrow-left",
        },
        breakpoints: {
            400: {
                slidesPerView: 2,
                spaceBetween: 10,
            },
            640: {
                slidesPerView: 2,
                spaceBetween: 10,
            },
            768: {
                slidesPerView: 4,
                spaceBetween: 10,
            },
            1024: {
                slidesPerView: 6,
                spaceBetween: 25,
            },
        },
    });
//     services slider
    let currentSlide = 0;

    const servicesSliderLine = document.querySelector('.services__slider-line');
    const servicesPrevBtn = document.querySelector('.services__arrow_left');
    const servicesNextBtn = document.querySelector('.services__arrow_right');

    servicesNextBtn.addEventListener('click', function () {
        currentSlide = currentSlide + 550;
        if (currentSlide > 1750) {
            currentSlide = 0;
        }
        servicesSliderLine.style.left = - currentSlide + 'px';
    })
    servicesPrevBtn.addEventListener('click', function () {
         currentSlide =  currentSlide - 550;
        if ( currentSlide <= 550) {
             currentSlide = 0;
        }
        servicesSliderLine.style.left =  currentSlide + 'px';
    })
});

